Skip to main content

All Questions

2votes
3answers
662views

Project Euler: Longest Collatz Sequence

The Collatz Sequence is an iterative sequence that is defined for all positive integers as such: n → n/2 (n is even) n → 3n + 1 (n is odd) If 13 were to be entered into this sequence, the result ...
user avatar
10votes
1answer
4kviews

Project Euler #14 -- longest Collatz sequence

I was reading this question and realized that I didn't know Python well enough to critique the algorithm. So I wrote a Java solution instead, which is inappropriate for that question. Since there's ...
Brythan's user avatar
  • 6,974
-2votes
1answer
9kviews

hailstone sequence using recursion in python [closed]

Douglas Hofstadter's Pulitzer-prize-winning book, Gödel, Escher, Bach, poses the following mathematical puzzle: Pick a positive integer n as the start. If n is even, divide it by 2. If n is ...
overexchange's user avatar

close